package com.ljf.daily.softwareautorecord.api.service.impl;

import com.ljf.common.api.service.impl.BasisServiceImpl;
import com.ljf.common.exception.ServiceException;
import com.ljf.common.result.ServiceResultModel;
import com.ljf.common.utils.ServiceResultUtil;
import com.ljf.config.vo.ConfigDatRecordSymbolVO;
import com.ljf.daily.softwareautorecord.domain.repository.DailyDatSoftwareAutoRecordRepository;
import com.ljf.daily.softwareautorecord.domain.service.DailyDatSoftwareAutoRecordDomainService;
import com.ljf.daily.softwareautorecord.domain.validator.DailyDatSoftwareAutoRecordValidator;
import com.ljf.daily.softwareautorecord.dto.command.DailyDatSoftwareAutoRecordCommand;
import com.ljf.daily.softwareautorecord.dto.query.DailyDatSoftwareAutoRecordQuery;
import com.ljf.daily.softwareautorecord.model.DailyDatSoftwareAutoRecord;
import com.ljf.daily.softwareautorecord.service.IDailyDatSoftwareAutoRecordService;
import com.ljf.daily.softwareautorecord.vo.DailyDatSoftwareAutoRecordVO;
import org.springframework.stereotype.Service;

import java.util.Date;
import java.util.List;

/**
 * 赚钱软件自动记录  服务接口实现
 *
 * @author LJF
 * @since 2024-12-14
 */
@Service
public class DailyDatSoftwareAutoRecordServiceImpl extends BasisServiceImpl<DailyDatSoftwareAutoRecordDomainService, DailyDatSoftwareAutoRecordValidator, DailyDatSoftwareAutoRecordRepository, DailyDatSoftwareAutoRecordQuery, DailyDatSoftwareAutoRecordVO, DailyDatSoftwareAutoRecord, DailyDatSoftwareAutoRecordCommand> implements IDailyDatSoftwareAutoRecordService {

    /**
     * 获取模板
     *
     * @param date
     * @param symbolCode
     * @return
     * @throws ServiceException
     */
    @Override
    public ServiceResultModel<DailyDatSoftwareAutoRecordVO> queryTemplate(Date date, String symbolCode) throws ServiceException {
        validator.checkQueryTemplate(date);
        List<DailyDatSoftwareAutoRecordVO> resultList = domainService.queryTemplate(date, symbolCode);
        return ServiceResultUtil.success(resultList);
    }

    /**
     * 查询赚钱软件自动记录标签
     *
     * @return
     * @throws ServiceException
     */
    @Override
    public ServiceResultModel<ConfigDatRecordSymbolVO> querySymbol() throws ServiceException {
        List<ConfigDatRecordSymbolVO> resultList = domainService.querySymbol();
        return ServiceResultUtil.success(resultList);
    }

}
